<?php

namespace app\api\controller;

use app\common\controller\PCBase;
use app\common\controller\DBase;
use app\api\logic\ApiStockUpLogic;
use Throwable;
use app\common\library\Upload;

class ApiStockUp extends DBase
{


    public function initialize(): void
    {
        parent::initialize();
    }


    /**
    * @desc    仓库安全库存
    * @date    2025/06/09
    * @author  zhangheng
    */
    public function SafetyStock()
    {
        $params     = $this->request->get();
        $ApiStockUpLogic = new ApiStockUpLogic();
        return $ApiStockUpLogic->SafetyStock($params);
    }

    /**
    * @desc    安全库存数量
    * @date    2025/06/09
    * @author  zhangheng
    */
    public function SafetyStockQuantity()
    {
        $params     = $this->request->get();
        $params['sku'] = "bra111-caramel-D";
        $params['SafetyStock'] = 7;
        $ApiStockUpLogic = new ApiStockUpLogic();
        return $ApiStockUpLogic->SafetyStockQuantity($params);
    }
    /**
    * @desc    平均日销
    * @date    2025/06/09
    * @author  zhangheng
    */
    public function AverageDailySales()
    {
        $params     = $this->request->get();
        $params['sku'] = "bra111-caramel-D";
        $params['SafetyStock'] = 7;
        $ApiStockUpLogic = new ApiStockUpLogic();
        return $ApiStockUpLogic->AverageDailySales($params);
    }

    /**
    * @desc    做货周期默认12天
    * @date    2025/06/09
    * @author  zhangheng
    */
    public function ProductionCycle()
    {
        $params     = $this->request->get();
        $ApiStockUpLogic = new ApiStockUpLogic();
        return $ApiStockUpLogic->ProductionCycle($params);
    }
    
    /**
    * @desc    物流运输默认3天
    * @date    2025/06/09
    * @author  zhangheng
    */
    public function Logistics()
    {
        $params     = $this->request->get();
        $ApiStockUpLogic = new ApiStockUpLogic();
        return $ApiStockUpLogic->Logistics($params);
    }
    
    /**
    * @desc    订单未发数量
    * @date    2025/06/09
    * @author  zhangheng
    */
    public function UnshippedQuantity()
    {
        $params     = $this->request->get();
        $params['sku'] = "bra111-caramel-D";
        $params['SafetyStock'] = 7;
        $ApiStockUpLogic = new ApiStockUpLogic();
        return $ApiStockUpLogic->UnshippedQuantity($params);
    }
    
    /**
    * @desc    采购在途数量
    * @date    2025/06/09
    * @author  zhangheng
    */
    public function ProcurementInTransit()
    {
        $params     = $this->request->get();
        $ApiStockUpLogic = new ApiStockUpLogic();
        return $ApiStockUpLogic->ProcurementInTransit($params);
    }
    
    /**
    * @desc    可用库存数量
    * @date    2025/06/09
    * @author  zhangheng
    */
    public function AvailableInventory()
    {
        $params     = $this->request->get();
        $ApiStockUpLogic = new ApiStockUpLogic();
        return $ApiStockUpLogic->AvailableInventory($params);
    }
    
    /**
    * @desc    补货数量
    * @date    2025/06/09
    * @author  zhangheng
    */
    public function Replenishment()
    {
        $params     = $this->request->get();
        $ApiStockUpLogic = new ApiStockUpLogic();
        return $ApiStockUpLogic->Replenishment($params);
    }
    
    /**
    * @desc    补单提醒
    * @date    2025/06/09
    * @author  zhangheng
    */
    public function SupplementReminder()
    {
        $params     = $this->request->get();
        $ApiStockUpLogic = new ApiStockUpLogic();
        return $ApiStockUpLogic->SupplementReminder($params);
    }

    /**
     * @desc   获取飞书在线表格数据
    * @date    2025/06/09
    * @author  zhangheng
     */
    public function getTablerecordsPants(){
        $data   = $this->request->post();
        return  (new ApiStockUpLogic())->getTablerecordsPants($data);
    }

}
